package com.yuanfeng.order.feign;

import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.commoms.vo.shop.ShopMemberVO;
import com.yuanfeng.commoms.vo.shop.ShopUserMessageResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Stranger
 * @date 2023/3/21 19:07
 */
@FeignClient(name = "mall-business", url = "http://localhost:8087")
public interface BusinessServiceClient {
    /**
     * 查询商品信息 售卖区域 运费信息 参加活动的活动信息等
     * @param message
     * @return
     */
    @PostMapping(value = "shop/transportTemplate/shipping/query")
    ResponseResult queryShipping(@RequestParam("message") String message);

    @GetMapping("shopBase/info/selectUserIdByShopId")
    ShopUserMessageResultVO queryUserId(@RequestParam("shopId") Integer shopId);

    /**
     * 更新门店库存
     * @param saleSum
     */
    @PostMapping("/shop/gate/update/shopGate/stock")
    ResponseResult updateShopGateStock(@RequestParam String saleSum);

    /**
     * 获取商品信息 及 活动信息
     *
     * @param goodsId
     * @return
     */
    @GetMapping("shop/transportTemplate/getGoodsDetails")
    ResponseResult getGoodsDetails(@RequestParam("goodsId") Integer goodsId);

    /**
     * 查询商家发票功能是否开启
     *
     * @param param Map<Object,Object>
     * @return ResultResp
     */
    @PostMapping(value = "/shopBase/info/query/shop/invoiceSwitchStatus")
    ResponseResult queryShopInvoiceSwitchStatus(@RequestBody Map<String,Object> param);

    /**
     * 商品门店查询
     *
     * @param param
     * @return
     */
    @PostMapping("/shop/gate/queryGateDetail")
    ResponseResult queryGateDetail(@RequestBody Map<String, Object> param);

    /**
     * 获取等级
     *
     * @param shopMember
     * @return
     */
    @PostMapping("/shop/memberGrade/getGradeByIds")
    ResponseResult getGradeByIds(@RequestBody ShopMemberVO shopMember);


    /**
     * 查找会员折扣
     *
     * @param shopId
     * @param userId
     * @return
     */
    @GetMapping("/shop/memberGradeSet/findMemberDiscount")
    ResponseResult findMemberDiscount(@RequestParam("shopId") Integer shopId, @RequestParam("userId") String userId);

    /**
     * 添加店铺评分
     *
     * @param param
     * @return
     */
    @PostMapping("/shop/evaluation/saveShopEvaluationInfo")
    ResponseResult saveShopEvaluationInfo(@RequestBody Map<String, Object> param);


    /**
     * 获取店铺发货地址信息
     *
     * @param shippingAddressId
     * @return
     */
    @PostMapping("/shop/shipping/address/queryShippingAddress")
    ResponseResult queryShippingAddress(@RequestParam("shippingAddressId") Integer shippingAddressId);

    /**
     * 查询门店店铺名称
     * @param orderGateShopId
     * @return
     */
    @PostMapping("/shop/gate/queryGateStoreName")
    public String queryGateStoreName(@RequestParam("orderGateShopId") Integer orderGateShopId);


    /**
     * 店铺评分
     * @param map
     * @return
     */
    @RequestMapping("/shop/avgEvaluation/shopScore")
    ResponseResult shopScore(@RequestBody Map<Object, Object> map);


    /**
     * 查找店铺合同信息
     *
     * @param shopId
     * @return
     */
    @GetMapping("shop/contract/getShopContract")
    ResponseResult getShopContract(@RequestParam("shopId") Integer shopId);
}
